<?php
function query($sql) {
    $connection = mysql_connect('localhost', 'root', 'vertrigo');
    mysql_select_db('tdc');
    
    $ketqua = mysql_query($sql);
    
    $data = array();
    while($row = mysql_fetch_assoc($ketqua)) {
        $data[] = $row;
    }
    return $data;
}